package com.xbdun.web.validatebmp.upload.core;

import java.util.List;

import com.xbdun.facade.validatebmp.upload.core.AllowUploadType;

public class UploadTypeUtil {
	private static List<AllowUploadType> listUploadType = null;//允许上传的业务类型
	/**
	 * 获取允许文件上传类型
	 * @param id 类型Id
	 * @return {@link AllowUploadType}
	 */
	public static AllowUploadType getAllowUploadType(int id){
		for(AllowUploadType type:listUploadType){
			if(type.getId()==id){
				return type;
			}
		}
		return null;
	}
	public static void setListUploadType(List<AllowUploadType> listUploadType) {
		if(null==UploadTypeUtil.listUploadType)
		UploadTypeUtil.listUploadType = listUploadType;
	}
}
